/*
 * These files are distributed under the terms of the GNU GPLv2, the GNU General
 * Public version 2. See LICENSE.txt
 */
package fileCommodore.plugin.usermenu;

import java.awt.*;

import javax.swing.*;

public class LabeledField extends JPanel
{
	private JLabel label;
	private JTextField input;
	
	public LabeledField(String display)
	{
		this(display, "");
	}
	
	public LabeledField(String display, String initialValue)
	{
		label = new JLabel(display, JLabel.RIGHT);
		input = new JTextField(initialValue);
		
		setLayout(new BorderLayout());
		
		add(label, BorderLayout.WEST);
		add(input, BorderLayout.CENTER);
	}
	
	public String getText()
	{
		return input.getText();
	}
	
	public void setText(String text)
	{
		input.setText(text);
	}
}
